package com.nycreativity.elecreativity.service;

import com.baomidou.mybatisplus.core.metadata.IPage
import com.nycreativity.elecreativity.entity.po.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.nycreativity.elecreativity.entity.param.PageParam
import com.nycreativity.elecreativity.entity.param.user.*
import com.nycreativity.elecreativity.entity.vo.user.UserVO

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author sxt && ttxxi
 * @since 2021-03-11
 */
interface UserService : IService<User>{

    fun addUser(userAddParam: UserAddParam): Boolean

    /**
     * 密码登录
     * @param phoneNum 电话号码
     * @param password 密码
     */
    fun loginViaPassword(phoneNum: String, password: String): UserVO?

    /**
     * 验证码登录
     * @param phoneNum 电话号码
     */
    fun loginViaPhoneNum(phoneNum: String): UserVO?

    /**
     * 验证码登录
     * @param email 邮箱
     * @param password 密码
     */
    fun loginViaEmail(email: String, password: String): UserVO?

    /**
     * 验证码登录
     * @param phoneNum 电话号码
     * @param password 新密码
     */
    fun updatePwdByPhoneNum(phoneNum: String, password: String): Boolean

    /**
     * 根据用户id更新
     */
    fun updateById(userUpdateParam: UserUpdateParam)

    /**
     * 更新电话号码
     */
    fun updatePhoneNum(userUpdatePhoneNumParam: UserUpdatePhoneNumParam): Boolean

    /**
     * 更新密码
     */
    fun updatePwd(userUpdatePwdParam: UserUpdatePwdParam): Boolean

    /**
     * 单纯的分页查找
     */
    fun queryByPage(pageParam: PageParam): IPage<UserVO>

    /**
     * 修改用户状态
     */
    fun updateStatus(userUpdateStatusParam: UserUpdateStatusParam): Boolean

}
